home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / uuencode.doc < prev    next >
Text File  |  1995-03-31  |  3KB  |  58 lines

  1. UUENCODE/UUDECODE by Theodore A. Kaldis 
  2.      This article by James H. Cloos 
  3.      Date: Wed Feb 13 1991 
  4.  
  5. [Note: Since things are often posted on the comp.sys.handhelds conference on 
  6. HP's Corvallis BBS in "unix-to-unix-encoded" (uuencoded) format, the serious 
  7. bbs-er needs a uudecoder.  It's on this disk, called "UUDECODE".  To use it, 
  8. type UUDECODE FILENAME at the DOS prompt, where 'filename' contains the 
  9. captured text from the "begin" to the "end" lines.  If you want to uuencode 
  10. something yourself so that you can upload it to the bbs, use UUENCODE FILENAME 
  11. which creates a copy of 'filename' with a .UUE extension.  Theodore Kaldis has 
  12. put this programs into the public domain with the understanding that they will 
  13. not be sold for profit.  See also EXTRACT2.DOC on this disk.  -jkh-]  
  14.  
  15. For those who are interested, below is the format of uuencoded files.  I know I 
  16. said that I'd work on translating it to the 48, but I've been flooded by rplc, 
  17. a project for class (a Huffman encoding exercise) and various other homework 
  18. assignments, ergo: no uuencode/decode for the 48 from me for a while!  If 
  19. anyone else wants to try, it looks like this:  
  20.  
  21.      Files output by uuencode(1C) consist of a header line, followed by a 
  22.      number of body lines, and a trailer line.  uudecode (see 
  23.      uuencode(1C)) will ignore any lines preceding the header or following 
  24.      the trailer.  Lines preceding a header must not, of course, look like 
  25.      a header.   
  26.  
  27.      The header line is distinguished by having the first 6 characters 
  28.      `begin '.  The word begin is followed by a mode (in octal), and a 
  29.      string which names the remote file.  Spaces separate the three items 
  30.      in the header line.   
  31.  
  32.      The body consists of a number of lines, each at most 62 characters 
  33.      long (including the trailing NEWLINE).  These consist of a character 
  34.      count, followed by encoded characters, followed by a NEWLINE.  The 
  35.      character count is a single printing character, and represents an 
  36.      integer, the number of bytes the rest of the line represents.  Such 
  37.      integers are always in the range from 0 to 63 and can be determined 
  38.      by subtracting the character space (octal 40) from the character.   
  39.  
  40.      Groups of 3 bytes are stored in 4 characters, 6 bits per character. 
  41.      All are offset by a SPACE to make the characters printing.  The last 
  42.      line may be shorter than the normal 45 bytes.  If the size is not a 
  43.      multiple of 3, this fact can be determined by the value of the count 
  44.      on the last line.  Extra garbage will be included to make the 
  45.      character count a multiple of 4.  The body is terminated by a line 
  46.      with a count of zero.  This line consists of one ASCII SPACE.   
  47.  
  48.      The trailer line consists of end on a line by itself.   
  49.  
  50. (exerpted from uuencode.5 man page from SunOS 4.1.1 w/o perm.) 
  51.  
  52. -JimC 
  53. -- 
  54. James H. Cloos, Jr.             Phone:  +1 716 673-1250 
  55. cloos@ACSU.Buffalo.EDU          Snail:  PersonalZipCode:  14048-0772, 
  56. USA 
  57. cloos@ub.UUCP                   Quote:  <> 
  58.